A good answer might be:

Yes. (Because parseInt can't convert the string "34.56" into an int).

Types of Exceptions

Here are two of the rules about how try/catch blocks work:

  1. The first catch{} block to match the type of exception thrown gets control.


  2. The most specific exception types should appear first in the structure, followed by the more general exception types.

To make full sense of these rules you need to know more about exception types. Here is a hierarchy diagram of Exception:

In arranging the try{} blocks, a child class should appear before any of its ancestors. If class A is not an ancestor or descendant of class B, then it doesn't matter which appears first.

QUESTION 10:

Should ArithmeticException appear before RunTimeException in the list of catch statements?